import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DataCheckVO, DataCheckForm, DataCheckQuery } from '@/api/data-check/types';

/**
 * 查询测试单-lwg列表
 * @param query
 * @returns {*}
 */

export const listDataCheck = (query?: DataCheckQuery): AxiosPromise<DataCheckVO[]> => {
  return request({
    url: '/data-check/data-check/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询测试单-lwg详细
 * @param id
 */
export const getDataCheck = (id: string | number): AxiosPromise<DataCheckVO> => {
  return request({
    url: '/data-check/data-check/' + id,
    method: 'get'
  });
};

/**
 * 新增测试单-lwg
 * @param data
 */
export const addDataCheck = (data: DataCheckForm) => {
  return request({
    url: '/data-check/data-check',
    method: 'post',
    data: data
  });
};

/**
 * 修改测试单-lwg
 * @param data
 */
export const updateDataCheck = (data: DataCheckForm) => {
  return request({
    url: '/data-check/data-check',
    method: 'put',
    data: data
  });
};

/**
 * 删除测试单-lwg
 * @param id
 */
export const delDataCheck = (id: string | number | Array<string | number>) => {
  return request({
    url: '/data-check/data-check/' + id,
    method: 'delete'
  });
};
